\(\int (a+b (c \sec (e+f x))^n)^p \tan ^3(e+f x) \, dx\) [464]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (warning: unable to verify)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 143 \[ \int \left (a+b (c \sec (e+f x))^n\right )^p \tan ^3(e+f x) \, dx=\frac {\operatorname {Hypergeometric2F1}\left (1,1+p,2+p,1+\frac {b (c \sec (e+f x))^n}{a}\right ) \left (a+b (c \sec (e+f x))^n\right )^{1+p}}{a f n (1+p)}+\frac {\operatorname {Hypergeometric2F1}\left (\frac {2}{n},-p,\frac {2+n}{n},-\frac {b (c \sec (e+f x))^n}{a}\right ) \sec ^2(e+f x) \left (a+b (c \sec (e+f x))^n\right )^p \left (1+\frac {b (c \sec (e+f x))^n}{a}\right )^{-p}}{2 f} \]

[Out]

hypergeom([1, p+1],[2+p],1+b*(c*sec(f*x+e))^n/a)*(a+b*(c*sec(f*x+e))^n)^(p+1)/a/f/n/(p+1)+1/2*hypergeom([-p, 2
/n],[(2+n)/n],-b*(c*sec(f*x+e))^n/a)*sec(f*x+e)^2*(a+b*(c*sec(f*x+e))^n)^p/f/((1+b*(c*sec(f*x+e))^n/a)^p)

Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {4224, 6874, 374, 12, 272, 67, 372, 371} \[ \int \left (a+b (c \sec (e+f x))^n\right )^p \tan ^3(e+f x) \, dx=\frac {\sec ^2(e+f x) \left (a+b (c \sec (e+f x))^n\right )^p \left (\frac {b (c \sec (e+f x))^n}{a}+1\right )^{-p} \operatorname {Hypergeometric2F1}\left (\frac {2}{n},-p,\frac {n+2}{n},-\frac {b (c \sec (e+f x))^n}{a}\right )}{2 f}+\frac {\left (a+b (c \sec (e+f x))^n\right )^{p+1} \operatorname {Hypergeometric2F1}\left (1,p+1,p+2,\frac {b (c \sec (e+f x))^n}{a}+1\right )}{a f n (p+1)} \]

[In]

Int[(a + b*(c*Sec[e + f*x])^n)^p*Tan[e + f*x]^3,x]

[Out]

(Hypergeometric2F1[1, 1 + p, 2 + p, 1 + (b*(c*Sec[e + f*x])^n)/a]*(a + b*(c*Sec[e + f*x])^n)^(1 + p))/(a*f*n*(
1 + p)) + (Hypergeometric2F1[2/n, -p, (2 + n)/n, -((b*(c*Sec[e + f*x])^n)/a)]*Sec[e + f*x]^2*(a + b*(c*Sec[e +
 f*x])^n)^p)/(2*f*(1 + (b*(c*Sec[e + f*x])^n)/a)^p)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 67

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x)^(n + 1)/(d*(n + 1)*(-d/(b*c))^m))
*Hypergeometric2F1[-m, n + 1, n + 2, 1 + d*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[n] && (Intege
rQ[m] || GtQ[-d/(b*c), 0])

Rule 272

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 372

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[a^IntPart[p]*((a + b*x^n)^FracPart[p]/
(1 + b*(x^n/a))^FracPart[p]), Int[(c*x)^m*(1 + b*(x^n/a))^p, x], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[
p, 0] &&  !(ILtQ[p, 0] || GtQ[a, 0])

Rule 374

Int[((d_.)*(x_))^(m_.)*((a_) + (b_.)*((c_)*(x_))^(n_))^(p_.), x_Symbol] :> Dist[1/c, Subst[Int[(d*(x/c))^m*(a
+ b*x^n)^p, x], x, c*x], x] /; FreeQ[{a, b, c, d, m, n, p}, x]

Rule 4224

Int[((a_) + (b_.)*((c_.)*sec[(e_.) + (f_.)*(x_)])^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With
[{ff = FreeFactors[Sec[e + f*x], x]}, Dist[1/f, Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a + b*(c*ff*x)^n)^p/x)
, x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[(m - 1)/2] && (GtQ[m, 0] || EqQ[
n, 2] || EqQ[n, 4] || IGtQ[p, 0] || IntegersQ[2*n, p])

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (-1+x^2\right ) \left (a+b (c x)^n\right )^p}{x} \, dx,x,\sec (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \left (-\frac {\left (a+b (c x)^n\right )^p}{x}+x \left (a+b (c x)^n\right )^p\right ) \, dx,x,\sec (e+f x)\right )}{f} \\ & = -\frac {\text {Subst}\left (\int \frac {\left (a+b (c x)^n\right )^p}{x} \, dx,x,\sec (e+f x)\right )}{f}+\frac {\text {Subst}\left (\int x \left (a+b (c x)^n\right )^p \, dx,x,\sec (e+f x)\right )}{f} \\ & = -\frac {\text {Subst}\left (\int \frac {c \left (a+b x^n\right )^p}{x} \, dx,x,c \sec (e+f x)\right )}{c f}+\frac {\text {Subst}\left (\int \frac {x \left (a+b x^n\right )^p}{c} \, dx,x,c \sec (e+f x)\right )}{c f} \\ & = -\frac {\text {Subst}\left (\int \frac {\left (a+b x^n\right )^p}{x} \, dx,x,c \sec (e+f x)\right )}{f}+\frac {\text {Subst}\left (\int x \left (a+b x^n\right )^p \, dx,x,c \sec (e+f x)\right )}{c^2 f} \\ & = -\frac {\text {Subst}\left (\int \frac {(a+b x)^p}{x} \, dx,x,(c \sec (e+f x))^n\right )}{f n}+\frac {\left (\left (a+b (c \sec (e+f x))^n\right )^p \left (1+\frac {b (c \sec (e+f x))^n}{a}\right )^{-p}\right ) \text {Subst}\left (\int x \left (1+\frac {b x^n}{a}\right )^p \, dx,x,c \sec (e+f x)\right )}{c^2 f} \\ & = \frac {\operatorname {Hypergeometric2F1}\left (1,1+p,2+p,1+\frac {b (c \sec (e+f x))^n}{a}\right ) \left (a+b (c \sec (e+f x))^n\right )^{1+p}}{a f n (1+p)}+\frac {\operatorname {Hypergeometric2F1}\left (\frac {2}{n},-p,\frac {2+n}{n},-\frac {b (c \sec (e+f x))^n}{a}\right ) \sec ^2(e+f x) \left (a+b (c \sec (e+f x))^n\right )^p \left (1+\frac {b (c \sec (e+f x))^n}{a}\right )^{-p}}{2 f} \\ \end{align*}

Mathematica [A] (warning: unable to verify)

Time = 6.43 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.13 \[ \int \left (a+b (c \sec (e+f x))^n\right )^p \tan ^3(e+f x) \, dx=\frac {\left (a+b (c \sec (e+f x))^n\right )^p \left (\frac {2 \operatorname {Hypergeometric2F1}\left (1,1+p,2+p,1+\frac {b \left (c \sqrt {\sec ^2(e+f x)}\right )^n}{a}\right ) \left (a+b \left (c \sqrt {\sec ^2(e+f x)}\right )^n\right )}{a n (1+p)}+\operatorname {Hypergeometric2F1}\left (\frac {2}{n},-p,\frac {2+n}{n},-\frac {b \left (c \sqrt {\sec ^2(e+f x)}\right )^n}{a}\right ) \sec ^2(e+f x) \left (1+\frac {b \left (c \sqrt {\sec ^2(e+f x)}\right )^n}{a}\right )^{-p}\right )}{2 f} \]

[In]

Integrate[(a + b*(c*Sec[e + f*x])^n)^p*Tan[e + f*x]^3,x]

[Out]

((a + b*(c*Sec[e + f*x])^n)^p*((2*Hypergeometric2F1[1, 1 + p, 2 + p, 1 + (b*(c*Sqrt[Sec[e + f*x]^2])^n)/a]*(a
+ b*(c*Sqrt[Sec[e + f*x]^2])^n))/(a*n*(1 + p)) + (Hypergeometric2F1[2/n, -p, (2 + n)/n, -((b*(c*Sqrt[Sec[e + f
*x]^2])^n)/a)]*Sec[e + f*x]^2)/(1 + (b*(c*Sqrt[Sec[e + f*x]^2])^n)/a)^p))/(2*f)

Maple [F]

\[\int \left (a +b \left (c \sec \left (f x +e \right )\right )^{n}\right )^{p} \tan \left (f x +e \right )^{3}d x\]

[In]

int((a+b*(c*sec(f*x+e))^n)^p*tan(f*x+e)^3,x)

[Out]

int((a+b*(c*sec(f*x+e))^n)^p*tan(f*x+e)^3,x)

Fricas [F]

\[ \int \left (a+b (c \sec (e+f x))^n\right )^p \tan ^3(e+f x) \, dx=\int { {\left (\left (c \sec \left (f x + e\right )\right )^{n} b + a\right )}^{p} \tan \left (f x + e\right )^{3} \,d x } \]

[In]

integrate((a+b*(c*sec(f*x+e))^n)^p*tan(f*x+e)^3,x, algorithm="fricas")

[Out]

integral(((c*sec(f*x + e))^n*b + a)^p*tan(f*x + e)^3, x)

Sympy [F]

\[ \int \left (a+b (c \sec (e+f x))^n\right )^p \tan ^3(e+f x) \, dx=\int \left (a + b \left (c \sec {\left (e + f x \right )}\right )^{n}\right )^{p} \tan ^{3}{\left (e + f x \right )}\, dx \]

[In]

integrate((a+b*(c*sec(f*x+e))**n)**p*tan(f*x+e)**3,x)

[Out]

Integral((a + b*(c*sec(e + f*x))**n)**p*tan(e + f*x)**3, x)

Maxima [F]

\[ \int \left (a+b (c \sec (e+f x))^n\right )^p \tan ^3(e+f x) \, dx=\int { {\left (\left (c \sec \left (f x + e\right )\right )^{n} b + a\right )}^{p} \tan \left (f x + e\right )^{3} \,d x } \]

[In]

integrate((a+b*(c*sec(f*x+e))^n)^p*tan(f*x+e)^3,x, algorithm="maxima")

[Out]

integrate(((c*sec(f*x + e))^n*b + a)^p*tan(f*x + e)^3, x)

Giac [F]

\[ \int \left (a+b (c \sec (e+f x))^n\right )^p \tan ^3(e+f x) \, dx=\int { {\left (\left (c \sec \left (f x + e\right )\right )^{n} b + a\right )}^{p} \tan \left (f x + e\right )^{3} \,d x } \]

[In]

integrate((a+b*(c*sec(f*x+e))^n)^p*tan(f*x+e)^3,x, algorithm="giac")

[Out]

integrate(((c*sec(f*x + e))^n*b + a)^p*tan(f*x + e)^3, x)

Mupad [F(-1)]

Timed out. \[ \int \left (a+b (c \sec (e+f x))^n\right )^p \tan ^3(e+f x) \, dx=\int {\mathrm {tan}\left (e+f\,x\right )}^3\,{\left (a+b\,{\left (\frac {c}{\cos \left (e+f\,x\right )}\right )}^n\right )}^p \,d x \]

[In]

int(tan(e + f*x)^3*(a + b*(c/cos(e + f*x))^n)^p,x)

[Out]

int(tan(e + f*x)^3*(a + b*(c/cos(e + f*x))^n)^p, x)